﻿function Post(anEndPoint) {
    this.endPoint = anEndPoint;
    this.buscarPost = Post_buscarPost;
}

function Post_buscarPost(idLogueado, idPost, funcionOk) {

    parametros = "{'idLogueado':'" + idLogueado +"', " + "'idPost':'" + idPost + "'}";

    $.ajax({
        type: "POST",
        url: this.endPoint,
        data: parametros,
        async: true, //por defecto es true
        contentType: "application/json; charset=utf-8",
        dataType: "json",
        success: function (response) {

            eval(funcionOk(response.d));
        },
        error: function (xhr, status, error) {
            alert(xhr.responseText);
        }
    });

}

